/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server.so.vezbac;

import domen.OpstiDomenskiObjekat;
import domen.Vezbac;
import server.baza.DataBaseBroker;
import server.so.OpstaSO;

/**
 *
 * @author Ivan Ivic
 */
public class SacuvajVezbaca extends OpstaSO {

    public synchronized static int sacuvajVezbaca(Vezbac v)
    {
        SacuvajVezbaca sv = new SacuvajVezbaca();
        return sv.opsteIzvrsenjeSO(v);
    }

    @Override
    public int izvrsenjeSO(OpstiDomenskiObjekat odo) {
        Vezbac v = (Vezbac) odo;
        signal = DataBaseBroker.getDbb().sacuvajObjekat(v);  // 9013, 9014
        return signal;
    }

    @Override
    public boolean stanjeOperacije(int signal) {
        switch(signal)
        {
            case 9013:
                prikazi(signal, "Slog uspesno sacuvan");
                return true;
            case 9014:
                prikazi(signal, "Slog nije uspesno sacuvan");
                return false;
            default:
                return false;
        }
    }    
}
